<?php 
$dbname = 'flug';
mysql_connect( 'localhost', 'msflug', 'Brandy362');
mysql_query("ALTER DATABASE `$dbname` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci");
$res = mysql_query("SHOW TABLES FROM `$dbname`");
while($row = mysql_fetch_row($res)) {
	$query = "ALTER TABLE {$dbname}.`{$row[0]}` CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci";
	mysql_query($query);
	$query = "ALTER TABLE {$dbname}.`{$row[0]}` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci";
	mysql_query($query);
}
echo 'all tables converted';
?>